<?xml version="1.0" encoding="UTF-8"?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1">
<jsp:directive.page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" />
<jsp:directive.page import="java.util.ArrayList, java.util.Iterator, cult.ticketing.bean.*" />
<jsp:output omit-xml-declaration="no" doctype-root-element="html" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" />
<jsp:include page="templates/include_header.html" />

<jsp:text><![CDATA[

<script type="text/javascript">
    function doUpdateMovie() {
      document.getElementById("manageUser").todo.value = "doUpdateMovie";
      document.getElementById("manageUser").submit();
    }
    function doDeleteMovie() {
      document.getElementById("manageUser").todo.value = "doDeleteMovie";
      document.getElementById("manageUser").submit();

    }
</script>

<link href="]]></jsp:text><jsp:expression>request.getContextPath()</jsp:expression><jsp:text><![CDATA[/css/style.css" rel="stylesheet" type="text/css" />
<link href="]]></jsp:text><jsp:expression>request.getContextPath()</jsp:expression><jsp:text><![CDATA[/css/scrollable-buttons.css" rel="stylesheet" type="text/css" />
<link href="]]></jsp:text><jsp:expression>request.getContextPath()</jsp:expression><jsp:text><![CDATA[/css/scrollable-horizontal.css" rel="stylesheet" type="text/css" />


</head>

<body>
<div id="container">

]]></jsp:text>

<jsp:include page="templates/include_menu.jsp" />
<jsp:include page="templates/search.jsp" />

<jsp:text><![CDATA[
<div id="main">
        <div id="content">
          <div id="head_image">
        	<div id="slogan"><strong>Cult Ticketing System  --  Manage</strong><br />
       	    </div>
            <div id="under_slogan_text">
                <br /><br /><br /><br />

            </div>
          </div>

         <div id="left">

            ]]></jsp:text>

        <jsp:include page="templates/login.jsp" />
        <jsp:include page="templates/manageLeftNav.jsp" />

         <jsp:text><![CDATA[
         </div>

         <div id="right">
            <h1>Update/Delete Movie</h1>
            <p>&nbsp;</p>

            <table cellpadding="0" cellspacing="0" border="0" class="sortable" id="sortable">
                <thead>
                    <th>Movie Image</th>
                    <th>Movie Info</th>
                    <th>Available Data</th>
                    <th>Introduction</th>
                </thead>
               <tbody>]]></jsp:text>

            <jsp:scriptlet>
              ArrayList&lt;Movie&gt; movies = (ArrayList&lt;Movie&gt;)request.getAttribute("movies");
              Iterator&lt;Movie&gt; it = movies.iterator();
              while (it.hasNext() != false) {
                pageContext.setAttribute("movie", (Movie)it.next());
            </jsp:scriptlet>
            <jsp:useBean id="movie" type="cult.ticketing.bean.Movie" scope="page" />

            <jsp:text><![CDATA[
            <form name="manageUser" id="manageUser" method="post" action="]]></jsp:text><jsp:expression>request.getContextPath()</jsp:expression><jsp:text><![CDATA[/index.do">
            <input type="hidden" name="todo" id="todo" value="" />
            <input type="hidden" name="movieId" id="movieId" value="]]></jsp:text><jsp:getProperty name="movie" property="id" /><jsp:text><![CDATA[" />
                <tr>
                    <td width="25%"><div class="movie_image"><img src="]]></jsp:text><jsp:expression>request.getContextPath()</jsp:expression><jsp:getProperty name="movie" property="imageURL" /><jsp:text><![CDATA[/></td><br /></div>
                        <div class="movie_info""><td><h3>]]></jsp:text><jsp:getProperty name="movie" property="title" /><jsp:text><![CDATA[</h3>
                            <span class="pl">Director: </span>]]></jsp:text><jsp:getProperty name="movie" property="director" /><jsp:text><![CDATA[<br />
                            <span class="pl">Leading Role: </span>]]></jsp:text><jsp:getProperty name="movie" property="actor" /><jsp:text><![CDATA[</td>
                            <td><span class="pl">Date: </span>]]></jsp:text><jsp:getProperty name="movie" property="availableDate" /><jsp:text><![CDATA[</td>
                            <td><span class="pl">Story: </span>]]></jsp:text><jsp:getProperty name="movie" property="intro" /><jsp:text><![CDATA[</td>
                        </div>
                </tr>
                <tr>
                        <div class="buy_button">
                        <td colspan="4" align="center">
                            <br />
                            <input type="button" onclick="javascript:doDeleteMovie();" id="delete" value="Delete" class="btn" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'"/>
                            <input type="button" onclick="javascript:doUpdateMovie();" id="update" value="Update" class="btn" onmouseover="this.className='btn btnhov'" onmouseout="this.className='btn'"/>
                            <br /><br /><br />

                        </td>
                        </div>
                    </td>
                </tr>


            </form>

             ]]></jsp:text>
            <jsp:scriptlet>
                pageContext.removeAttribute("movie");
              }
            </jsp:scriptlet>
        <jsp:text><![CDATA[                 </tbody>
            </table>
        </div>

        </div>
</div>
</div>


]]></jsp:text>
            <jsp:include page="templates/include_footer.html" />
         <jsp:text><![CDATA[


             ]]></jsp:text>
</jsp:root>

